$(function() {
	$('.nav-first-level-item').click(function () {
		if ($(this).next().hasClass('fa-angle-down')) {
			$(this).next().removeClass('fa-angle-down').addClass('fa-angle-up');
			$(this).next().next().addClass('nav-first-level-item-open');
			$(this).next().next().show();
		} else {
			$(this).next().removeClass('fa-angle-up').addClass('fa-angle-down');
			$(this).next().next().removeClass('nav-first-level-item-open');
			$(this).next().next().hide();
		}
	});
	$('#ulogout > a').click(function () {
		//
		$.ajax({
 			url: '/api/auth/logout',
 			data: '',
 			dataType: 'json',
 			method: 'post',
 			success: function(_response) {
 				if(_response.isSuccess) {
 					layer.msg('已安全退出！', {icon: 1});
 					window.location.href = '/html/authen/login.html';
 				} else {
 					layer.msg('退出失败！', {icon: 2});
 				}
 			},
 			error:function(xhr, textStatus) {
 				console.log(xhr);
 			}
 		});
	});
});